home *** CD-ROM | disk | FTP | other *** search
- From: Namic@msn.com (The ugly pink sweater book The Orange book is)
- Subject: Dumb Question? about ptr
- Date: 10 Jan 96 23:10:12 -0800
- Message-ID: <00001a81+00008b8f@msn.com>
- Path: news.msn.com!msn.com
- Newsgroups: comp.lang.c++
- Organization: The Microsoft Network (msn.com)
-
- Dont laugh im only been programming in this for a few hours but why is
- this giving me the following errors in Line 11 (I copied straight out
- o a how to program in C++ book. Yes the compilers match i have
- Borland C++ 4.02
-
- Error NONAME00.CPP 11: Type name expected
- Error NONAME00.CPP 11: Variable 'foo' is initialized more than once
- Error NONAME00.CPP 11: Improper use of typedef 'MyStruct'
-
-
- #include <iostream.h>
-
- class MyStruct {
- public:
- int data;
- int value;
- };
-
- MyStruct *foo;
- MyStruct Record1;
- foo = &MyStruct;
-
- void main() {
- foo->data=5;
- cout << foo->data;
- };
-